package cn.tedu.spring.di;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {
    public static void main(String[] args) {
        //创建IOC容器，将创建的对象放入IOC容器
        AnnotationConfigApplicationContext context=new AnnotationConfigApplicationContext
        ("cn.tedu.spring.di");
        // 取出IOC容器的对象
//        UserDao user=context.getBean(UserDao.class);
//        user.password("123456");
//
//        System.out.println("UserDao="+user);
        UserService us=context.getBean(UserService.class);
        System.out.println("UserService="+us);




    }
}
